﻿using Microsoft.Extensions.Logging;
using my.abp.Domain.Shared.Etos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus;
using Volo.Abp.EventBus.Distributed;

namespace my.abp.Domain.EventHandlers
{
	/// <summary>
	/// 分布式登录事件
	/// </summary>
	public class LoginDistributedEventHandler : IDistributedEventHandler<LoginEventArgs>
		, ITransientDependency
	{
		private readonly ILogger<LoginDistributedEventHandler> _logger;

		public LoginDistributedEventHandler(ILogger<LoginDistributedEventHandler> logger) { _logger = logger; }

		public async Task HandleEventAsync(LoginEventArgs eventData)
		{
			_logger.LogInformation($"分布式事件总线-用户【{eventData.UserId}:{eventData.UserName}】登入系统");
		}
	}
}
